<?php

namespace app\api\model;

use app\common\model\BaseModel;
use think\model\concern\SoftDelete;

class MerchantArea extends BaseModel
{

    use SoftDelete;

    

    // 表名
    protected $name = 'merchant_area';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [
    ];




    //状态
    public function getStatusList($status = null)
    {
        $data = ['1' => __('启用'), '2' => __('禁用')];
        if ($status){
            return $data[$status];
        }else{
            return $data;
        }
    }

    public function merchant(){
        return $this->hasOne('merchant','id','merchant_id')->joinType('left');
    }


}
